<?php
//echo "<pre>";print_r($this->arr);exit;
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

jimport('joomla.language.helper');
$languages = JLanguageHelper::getLanguages('lang_code');
$lang_code = JFactory::getLanguage()->getTag();
$lang = $languages[$lang_code]->sef;

JHTML::_('behavior.tooltip');
$db = JFactory::getDbo();
if($lang == "en"){
    //$res = array("Amigo Grill Restaurant","Café Central An Dong","Café Central Nguyen Hue","Gartenstadt Restaurant","Kissho Restaurant","Ngan Dinh Restaurant","Top of the Town Bar & Restaurant","The Royal Pavilion","The Long @ Times Square","R&J Italian Lounge & Restaurant");
    $res = array("Amigo Grill Restaurant","Café Central An Dong","Café Central Nguyen Hue","Gartenstadt Restaurant","Kissho Restaurant","Ngan Dinh Restaurant","Top of the Town Bar & Restaurant","The Royal Pavilion","The Long @ Times Square","R&J Italian Lounge & Restaurant","Cafe Cardinal");
}
else {
    //$res = array("Nhà hàng Amigo","Café Central An Đông","Café Central Nguyễn Huệ","Nhà hàng Đức Bảo","Nhà hàng Kissho","Nhà hàng Ngân Đình","Nhà hàng Top of the Town","Nhà hàng Long Triều","The Long @ Times Square","R&J Italian Lounge & Restaurant");
    $res = array("Nhà hàng Amigo","Café Central An Đông","Café Central Nguyễn Huệ","Nhà hàng Đức Bảo","Nhà hàng Kissho","Nhà hàng Ngân Đình","Nhà hàng Top of the Town","Nhà hàng Long Triều","The Long @ Times Square","Nhà hàng R&J","Cafe Cardinal");

}
?>
<link href="./datepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">	
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
 
<link rel="stylesheet" href="components/com_wmcreservation/assets/css/wmcreservation.css" type="text/css" />
<link rel="stylesheet" href="components/com_wmcreservation/assets/css/1140.css" type="text/css" />

<p class="err_txt error_notice_box"><?php echo JText::_('WMC_RESERVATION_ERR_TXT');?></p>
<div class="page-header">
    <h1 class="wmc_heading"><strong><?php echo JText::_('WMC_RESERVATION_AT_RESTAURENT');?> <a href="<?php echo JRoute::_('index.php?option=com_wmcreservation&view=wmcreservation&Itemid=168')?>"><div class="reservation <?php echo "reservation_".$lang;?>"></div></a></strong></h1>
</div>
<div class="contentmain">
<div class="postcontent nobottommargin">
<script>

</script>
<div class="single-portfolio-image">
<form onsubmit="return checkForm()" action='<?php echo $lang == "en" ? JRoute::_("index.php?option=com_wmcreservation&view=wmcreservation#thankyou"):JRoute::_("index.php?option=com_wmcreservation&view=wmcreservation#camon")?>' enctype="multipart/form-data" id="userForm" method="post">
<p class="reservation_info"><?php echo JText::_('WMC_RESERVATION_INTRO_FIRST');?></p>
<p><?php echo JText::_('WMC_RESERVATION_INTRO');?></p>
<br/>
<div class="row">
<div class="column6 col_lef">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
	<td width="81"><?php echo JText::_('WMC_RESERVATION_RESTAURENT');?>: <font color="#cd0022">*</font></td>
	<td width="">
	<select onchange="changeRestaurent('<?php echo $lang;?>');" class="restaurent" id="restaurent" name="restaurent">
		<option selected value="0_<?php echo $lang;?>"><?php echo JText::_('WMC_RESERVATION_SELECT_RESTAURANT') ?></option>
		<?php for($i=0;$i< count($res);$i++): ?>

			<option value="<?php echo ($i+1)."_".$lang;?>"><?php echo $res[$i]; ?></option>

		<?php endfor; ?>
	</select>
	
	</td>
</tr>
<tr>
	<td class="wmc_outlet_nd_warning" width="81" colspan="2"><font color="#cd0022"><?php echo JText::_('WMC_OUTLET_ND_WARNING');?></font></td>
</tr>
<tr>
<td><?php echo JText::_('WMC_RESERVATION_DATE');?>: <font color="#cd0022">*</font></td>
<td>
	<div style="text-align: right;" class="input-group date form_date col-md-5" data-date="" data-date-format="dd-mm-yyyy" data-link-field="dtp_input2" data-link-format="yyyy-mm-dd">
	    <input class="form-control" size="16" type="text" id="date" name="date" value="" style="cursor: pointer;width: 165px;" readonly>
		<span class="input-group-addon"><button class="glyphicon glyphicon-calendar" style=" opacity: 0.8;padding: 4px;margin-bottom: 11px;padding-bottom: 5px;  padding-top: 3px;"></button></span>
	</div>
</td>
</tr>
<tr>
<td>

</td>
</tr>
<tr>
<td colspan="2" style="padding-top: 8px;padding-bottom: 6px;">
<table width="100%">
<tr>
<td><?php echo JText::_('WMC_RESERVATION_TIME');?>: &nbsp;&nbsp; </td>
<td style="width: 37.3%;">

<select style="width: 44px !important;padding-left: 0px !important;padding-right: 0px !important;" class="" id="hours" name="hours">
	<option value="01"> 01 </option>
	<option value="02"> 02 </option>
	<option value="03"> 03 </option>
	<option value="04"> 04 </option>
	<option value="05"> 05 </option>
	<option value="06"> 06 </option>
	<option value="07"> 07 </option>
	<option value="08"> 08 </option>
	<option value="09"> 09 </option>
	<option value="10"> 10 </option>
	<option value="11"> 11 </option>
	<option value="12"> 12 </option>
	<option value="13"> 13 </option>
	<option value="14"> 14 </option>
	<option value="15"> 15 </option>
	<option value="16"> 16 </option>
	<option value="17"> 17 </option>
	<option value="18"> 18 </option>
	<option value="19"> 19 </option>
	<option value="20"> 20 </option>
	<option value="21"> 21 </option>
	<option value="22"> 22 </option>
	<option value="23"> 23 </option>
</select>
<?php echo JText::_('WMC_RESERVATION_HOURS');?>
</td>
<td style="width: 36%; text-align: center;">

<select style="width: 44px !important;padding-left: 0px !important;padding-right: 0px !important;" class="" id="minutes" name="minutes">
	<option value="00"> 00 </option>
	<option value="15"> 15 </option>
	<option value="30"> 30 </option>
	<option value="45"> 45 </option>
</select>
<?php echo JText::_('WMC_RESERVATION_MINUTES');?>

</td>

<td>
<!-- <select style="width: 44px !important;padding-left: 0px !important;padding-right: 0px !important;" class="" id="am" name="am">
	<option value="<?php echo JText::_('WMC_RESERVATION_AM');?>"><?php echo JText::_('WMC_RESERVATION_AM');?></option>
	<option value="<?php echo JText::_('WMC_RESERVATION_PM');?>"><?php echo JText::_('WMC_RESERVATION_PM');?></option>
</select> -->


</td></tr>
</table>		
</td>		
</tr>
	<tr class="label_open_hours">
	<td width="81" class="open_hours_title"><?php echo JText::_('WMC_OUTLET_OPEN_HOURS');?>: </td>
	<td class="wmc_outlet_amigo_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_AMIGO_OPEN_HOURS');?></td>
	<td class="wmc_outlet_ccad_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_CCAD_OPEN_HOURS');?></td>	
	<td class="wmc_outlet_ducbao_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_DUCBAO_OPEN_HOURS');?></td>	
	<td class="wmc_outlet_kissho_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_KISSHO_OPEN_HOURS');?></td>	
	<td class="wmc_outlet_nd_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_ND_OPEN_HOURS');?></td>	
	<td class="wmc_outlet_tott_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_TOTT_OPEN_HOURS');?></td>	
	<td class="wmc_outlet_ccnh_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_CCNH_OPEN_HOURS');?></td>		
	<td class="wmc_outlet_longtrieu_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_LONGTRIEU_OPEN_HOURS');?></td>		
	<td class="wmc_outlet_thelong_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_THELONG_OPEN_HOURS');?></td>		
	<td class="wmc_outlet_randj_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_RANDJ_OPEN_HOURS');?></td>	
	<td class="wmc_outlet_cafecardinal_open_hours open_hours" width="115"><?php echo JText::_('WMC_OUTLET_CAFECARDINAL_OPEN_HOURS');?></td>		
	</tr>	
<tr>
<tr><td style="color:white;" height="15"></td></tr>
<td width="70"><?php echo JText::_('WMC_RESERVATION_PARTY_SIZE');?>: <font color="#cd0022">*</font></td>
<td width="115"><input onkeypress="return checkPartySize(event,this.value);" type="text" class="" id="part_size" name="party_size" value=""></td>	
</tr>	



</table>

</div><!-- end div.column6 first -->
<!----------------------------------------------------------------------------------------------->
<div class="column6 col_rig">
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>
	<td width=""><?php echo JText::_('WMC_RESERVATION_TITLE');?>:</td>
	<td width="">
		<select class="" id="prefix" name="prefix">
			<option value="<?php echo JText::_('WMC_RESERVATION_MR');?>."><?php echo JText::_('WMC_RESERVATION_MR');?>.</option>
			<option value="<?php echo JText::_('WMC_RESERVATION_MRS');?>."><?php echo JText::_('WMC_RESERVATION_MRS');?>.</option>
			<option value="<?php echo JText::_('WMC_RESERVATION_MS');?>."><?php echo JText::_('WMC_RESERVATION_MS');?>.</option>
		</select>
	</td>
</tr>
<tr>
		<td><?php echo JText::_('WMC_RESERVATION_FNAME');?>: <font color="#cd0022">*</font></td>
		<td><input  type="text" class="" id="f_name" name="f_name" value=""></td>
</tr>	
			
<tr>
	<td><?php echo JText::_('WMC_RESERVATION_LNAME');?>: <font color="#cd0022">*</font></td>
	<td><input  type="text" class="" id="l_name" name="l_name"  value=""></td>
</tr>	
<tr>
	<td colspan="1"><?php echo JText::_('WMC_RESERVATION_CONTACT_NUMBER');?>: <font color="#cd0022">*</font></td>
	<td colspan="3"><input onkeypress="return checkPhone(event,this.value);" type="text" class="" id="phone" name="phone"  value=""></td>	
</tr>

<tr>
	<td width="80"><?php echo JText::_('WMC_RESERVATION_EMAIL');?>: <font color="#cd0022">*</font>
	</td>
	<td><input onkeypress="return checkEmail(this.value);" type="text" class="" id="email" name="email" value=""></td>
</tr>

</table>

</div>
</div><!--end div.row-->
<!----------------------------------------------------------------------------------------->
<!--><div class="row req_special">
<div class="column12">

<table width="100%">
<tr><td colspan="4"><?php echo JText::_('WMC_RESERVATION_SPECIAL');?>:</td></tr>
<tr>

<td class="formatspace" colspan="4">
	
	<input type="checkbox" id="req0" value="<?php echo JText::_('WMC_RESERVATION_THE_SMOKING');?>" name="req2"><label><?php echo JText::_('WMC_RESERVATION_THE_SMOKING');?></label><br>
	<input type="checkbox" id="req1" value="<?php echo JText::_('WMC_RESERVATION_THE_NON_SMOKING');?>" name="req3"><label><?php echo JText::_('WMC_RESERVATION_THE_NON_SMOKING');?></label><br>
	<input type="checkbox" id="req2" value="<?php echo JText::_('WMC_RESERVATION_THE_PRIVATE');?>" name="req4"><label><?php echo JText::_('WMC_RESERVATION_THE_PRIVATE');?></label><br>
</td>

</tr>

</table>

</div>
</div><!-- end div.row -->
<!----------------------------------------------------------------------------------------->

<div class="row">
<div class="column12 column12_franky_fit">
<table width="100%" style="margin-left: -2px;">
<tr>
<td valign="top""><?php echo JText::_('WMC_RESERVATION_PLEASE_NOE');?></td>		
</tr>
<tr>
<td  align="left">
<textarea class="special" id="special" name="special" rows="7"></textarea>
	</td>
</tr>
 <tr>
<td colspan="2" align="left"><input type="submit" class="frmbtn btn-warning" id="submit" name="submit" value="<?php echo JText::_('WMC_RESERVATION_SUBMIT');?>"></td>		
</tr>

</table>

</div>
</div><!-- end div.row -->
<!----------------------------------------------------------------------------------------->

</form>
</div>
</div>
<!------------------------------------------------------------------------------------------------------->
<div class="portfolio-meta nobottommargin col_last">
		
		<div class="single-portfolio-description">
			<ul class="desc">
				<li style="display: block;" class="li_des wmc_<?php echo $lang;?>">
					<?php if(!empty($this->arr['wmc']['img'])): ?><img  class="logo_outlets" src="<?php echo $this->arr['wmc']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['wmc']['introtext_'.$lang]?>
				</li>
				
				<li class="li_des amigo_<?php echo $lang;?>">
					<?php if(!empty($this->arr['amigo']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['amigo']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['amigo']['introtext_'.$lang]?>
				</li>
				
				<li class="li_des ccad_<?php echo $lang;?>">
					<?php if(!empty($this->arr['ccad']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['ccad']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['ccad']['introtext_'.$lang]?>
				</li>
				
				<li class="li_des ccnh_<?php echo $lang;?>">
					<?php if(!empty($this->arr['ccnh']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['ccnh']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['ccnh']['introtext_'.$lang]?>
				</li>
				
				<li class="li_des ducbao_<?php echo $lang;?>">
					<?php if(!empty($this->arr['ducbao']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['ducbao']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['ducbao']['introtext_'.$lang]?>
				</li>
				
				<li  class="li_des kissho_<?php echo $lang;?>">
					<?php if(!empty($this->arr['kissho']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['kissho']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['kissho']['introtext_'.$lang]?>
				</li>
				
				<li class="li_des ngandinh_<?php echo $lang;?>">
					<?php if(!empty($this->arr['ngandinh']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['ngandinh']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['ngandinh']['introtext_'.$lang]?>
				</li>
				
				<li class="li_des tott_<?php echo $lang;?>">
					<?php if(!empty($this->arr['tott']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['tott']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['tott']['introtext_'.$lang]?>
				</li>
				
				<li class="li_des longtrieu_<?php echo $lang;?>">
					<?php if(!empty($this->arr['longtrieu']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['longtrieu']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['longtrieu']['introtext_'.$lang]?>
				</li>
                
				<li class="li_des thelong_<?php echo $lang;?>">
					<?php if(!empty($this->arr['thelong']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['thelong']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['thelong']['introtext_'.$lang]?>
				</li>
                
				<li class="li_des randj_<?php echo $lang;?>">
					<?php if(!empty($this->arr['randj']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['randj']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['randj']['introtext_'.$lang]?>
				</li>
                
				<li class="li_des cafecardinal_<?php echo $lang;?>">
					<?php if(!empty($this->arr['cafecardinal']['img'])): ?><img class="logo_outlets" src="<?php echo $this->arr['cafecardinal']['img'] ?>" /> <?php endif;?>
					<h4><?php echo ($lang == "en") ? "Description ": "Mô tả "; ?></h4>
					<?php echo $this->arr['cafecardinal']['introtext_'.$lang]?>
				</li>
				
            </ul>
                        
		</div>
	</div>
<div class="doubleline"></div>
<!------------------------------------------------------------------------------------------------------->

<!------------------------------------------------------------------------------------------------------->
</div><!-- end div.contentmain -->

<script src="components/com_wmcreservation/assets/js/wmcreservation.js" type="text/javascript"></script>
<script type="text/javascript" src="datepicker/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="datepicker/js/locales/bootstrap-datetimepicker.vn.js" charset="UTF-8"></script>
<script type="text/javascript">
	var dateToday = new Date();
    $('.form_datetime').datetimepicker({
        //language:  'fr',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		forceParse: 0,
        showMeridian: 1
    });
    if ("<?php echo substr(JFactory::getLanguage()->getTag(),0,2); ?>" == "vi") {
    	$('.form_date').datetimepicker({
        language:  'vn',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		startDate: dateToday,
		forceParse: 0
    	});
    }else{
    	$('.form_date').datetimepicker({
        language:  'en',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		startDate: dateToday,
		forceParse: 0
    	});
    }

	$('.form_time').datetimepicker({
        language:  'fr',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 1,
		minView: 0,
		maxView: 1,
		forceParse: 0
    });

    
</script>